package com.power.ding.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  用户部门关系实体类
*/

@Entity
@ApiModel(value="用户部门关系")
@Data
@Table(name="Di_userdept")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Di_userdept.Di_userdeptPK.class) 用于复合组件
public class Di_userdept extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    /**
     * -1已删除；>=0正常
     */
    @ApiModelProperty(value = "删除标识")
    private Integer rowState;

    @ApiModelProperty(value = "最后修改时间", example="2020-10-22 10:03:22")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastUpdateTime;

    @ApiModelProperty(value = "用户ID")
    private String userId;

    @ApiModelProperty(value = "部门ID")
    private String orgId;

    @ApiModelProperty(value = "机构ID")
    private String unitId;

    /**
     * -1否，1是
     */
    @ApiModelProperty(value = "是否主部门")
    private Integer isMain;

    @ApiModelProperty(value = "是否主部门文本")
    private String IsMainText;

    @ApiModelProperty(value = "显示顺序")
    private Integer showOrder;

    @ApiModelProperty(value = "部门名称")
    private String orgName;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("rowState", this.getRowState());
        map.put("lastUpdateTime", this.getLastUpdateTime());
        map.put("userId", this.getUserId());
        map.put("orgId", this.getOrgId());
        map.put("unitId", this.getUnitId());
        map.put("isMain", this.getIsMain());
        map.put("IsMainText", this.getIsMainText());
        map.put("showOrder", this.getShowOrder());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Di_userdeptPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Di_userdeptPK pk = (Di_userdeptPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}